package com.ruoyi.project.beautyflower.loanPurpose.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.beautyflower.loanPurpose.mapper.LoanPurposeMapper;
import com.ruoyi.project.beautyflower.loanPurpose.domain.LoanPurpose;
import com.ruoyi.project.beautyflower.loanPurpose.service.ILoanPurposeService;
import com.ruoyi.common.support.Convert;

/**
 * 借款用途设置 服务层实现
 * 
 * @author lxs
 * @date 2018-10-09
 */
@Service
public class LoanPurposeServiceImpl implements ILoanPurposeService 
{
	@Autowired
	private LoanPurposeMapper loanPurposeMapper;

	/**
     * 查询借款用途设置信息
     * 
     * @param id 借款用途设置ID
     * @return 借款用途设置信息
     */
    @Override
	public LoanPurpose selectLoanPurposeById(Integer id)
	{
	    return loanPurposeMapper.selectLoanPurposeById(id);
	}
	
	/**
     * 查询借款用途设置列表
     * 
     * @param loanPurpose 借款用途设置信息
     * @return 借款用途设置集合
     */
	@Override
	public List<LoanPurpose> selectLoanPurposeList(LoanPurpose loanPurpose)
	{
	    return loanPurposeMapper.selectLoanPurposeList(loanPurpose);
	}
	
    /**
     * 新增借款用途设置
     * 
     * @param loanPurpose 借款用途设置信息
     * @return 结果
     */
	@Override
	public int insertLoanPurpose(LoanPurpose loanPurpose)
	{
	    return loanPurposeMapper.insertLoanPurpose(loanPurpose);
	}
	
	/**
     * 修改借款用途设置
     * 
     * @param loanPurpose 借款用途设置信息
     * @return 结果
     */
	@Override
	public int updateLoanPurpose(LoanPurpose loanPurpose)
	{
	    return loanPurposeMapper.updateLoanPurpose(loanPurpose);
	}

	/**
     * 删除借款用途设置对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteLoanPurposeByIds(String ids)
	{
		return loanPurposeMapper.deleteLoanPurposeByIds(Convert.toStrArray(ids));
	}
	
}
